package com.echo.im.client.model;


import lombok.Data;

import java.util.LinkedList;
import java.util.List;

/**
 * @author: echo
 * @time: 2024-08-23
 */
@Data
public class IMMessage<T> {
    /**
     * 发送方
     */
    private IMUserInfo sender;

    /**
     * 接收者终端类型,默认全部
     */
    private List<Integer> recvTerminals = IMTerminalType.codes();

    /**
     * 是否发送给自己的其他终端,默认true
     */
    private Boolean sendToSelf = true;

    /**
     * 是否需要回推发送结果,默认true
     */
    private Boolean sendResult = true;

    /**
     * 消息内容
     */
    private T data;

    /**
     * 接收者id列表(群成员列表,为空则不会推送)
     */
    private List<Long> recvIds = new LinkedList<>();

    private Boolean isNeedOfflineStore = true;

    private Byte cmd;

    private Long seqId;

    private Long msgId;


    public IMMessage(Long msgId, Long seqId, Byte cmd, Boolean isNeedOfflineStore) {
        this.msgId = msgId;
        this.seqId = seqId;
        this.cmd = cmd;
        this.isNeedOfflineStore = isNeedOfflineStore;
    }
}
